package com.slz3.business.module.messageManagement.mesActivity.steward;

import com.slz3.business.module.messageManagement.mesActivity.domain.MesActivity;
import com.slz3.business.module.messageManagement.mesActivity.domain.MesActivityCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class MesActivityResponse {

    @Resource
    private MesActivityResController mesActivityResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(MesActivity.class).flatMap(mesActivity ->
                mesActivityResController.add(req, mesActivity)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.delete(req, mesActivityCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(MesActivity.class).flatMap(mesActivity ->
                mesActivityResController.modify(req, mesActivity)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return mesActivityResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return mesActivityResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return mesActivityResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.auditSubmit(req, mesActivityCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.audit(req, mesActivityCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.auditReject(req, mesActivityCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.usingEnable(req, mesActivityCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(MesActivityCondition.class).flatMap(mesActivityCondition ->
                mesActivityResController.usingDisable(req, mesActivityCondition)
        );
    }   

}
